package com.netflexitysolutions.amazonws.ec2;

import java.util.HashMap;
import java.util.Map;

public enum ImageState {
	
	AVAILABLE("available"), DEREGISTERED("deregistered");
	
	private static Map<String, ImageState> stateByName = new HashMap<String, ImageState>();
	
	static {
		ImageState[] states = ImageState.values();
		for (ImageState state : states) {
			stateByName.put(state.getName(), state);
		}
	}
	
	public static ImageState imageStateForName(String name) {
		return stateByName.get(name);
	}
	
	private String name;
	
	private ImageState(String name) {
		this.name = name;
	}
	
	public String getName() {
		return name;
	}
	
}
